#include "musicplayer.h"


MusicPlayer::MusicPlayer() { myPlayer = new QMediaPlayer; }

void MusicPlayer::playMusic(QString path) {
  // myPlayer->setMedia(QUrl(path)); // 指定源为qrc文件
  // myPlayer->setVolume(20);
  myPlayer->play();
}

void MusicPlayer::stopMusic() { myPlayer->stop(); }
